from django.utils.deprecation import MiddlewareMixin


class MyFrameMiddleware(MiddlewareMixin):   # 自定义中间件
    def process_response(self,request,response):
        if str(request.path).find('aaa/')!=-1:
            response["X-Frame-Options"] = "SAMEORIGIN"
            print("------X-Frame-Options-------")
            print(request.path)
        return response